package com.xunyun.kotlinwc

import android.os.Bundle
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.LabelVisibilityMode
import com.xunyun.kotlinwc.base.BaseActivity
import com.xunyun.kotlinwc.base.BaseViewModel
import com.xunyun.kotlinwc.databinding.ActivityMainBinding


class MainActivity : BaseActivity<ActivityMainBinding, BaseViewModel>() {

    override fun getLayoutId(): Int {
        return R.layout.activity_main
    }

    override fun getViewModel(): BaseViewModel {
        return BaseViewModel()
    }

    override fun bindViewModel() {

    }

    override fun initView(savedInstanceState: Bundle?) {
        //fragment里面的id一定要跟menu资源文件item的id相一致，否则会出现BottomNavigationView按钮无法点击的问题
        val navController = findNavController(R.id.nav_host_fragment)
        //当tab大于3个时需要设置
        mBinding.navView.labelVisibilityMode = LabelVisibilityMode.LABEL_VISIBILITY_LABELED
        mBinding.navView.setupWithNavController(navController)

        mBinding.navView .setOnNavigationItemReselectedListener {}
    }

    override fun initData() {

    }
}